home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
Dev
/
Oberon
/
source
/
Library
/
ANSI.mod
< prev
next >
Wrap
Text File
|
1995-05-23
|
4KB
|
176 lines
<* STANDARD- *>
MODULE ANSI;
IMPORT Dos, (*ASCII,*) IO := BufIO;
VAR ansi *: BOOLEAN;
(* Flash the display - do an Intuition.DisplayBeep () *)
PROCEDURE Bell* (fh: Dos.FileHandlePtr);
BEGIN IF ansi THEN
IO.WriteStr (fh, "\x07")
END
END Bell;
(* Move left one column *)
PROCEDURE Backspace* (fh: Dos.FileHandlePtr);
BEGIN IF ansi THEN
IO.WriteStr (fh, "\x08")
END
END Backspace;
(* Move right one tab stop *)
PROCEDURE HorizontalTab* (fh: Dos.FileHandlePtr);
BEGIN IF ansi THEN
IO.WriteStr (fh, "\x09")
END
END HorizontalTab;
(* Move down one text line as specified by the mode fuction *)
PROCEDURE LineFeed* (fh: Dos.FileHandlePtr);
BEGIN IF ansi THEN
IO.WriteStr (fh, "\x0A")
END
END LineFeed;
(* Move up one text line *)
PROCEDURE VerticalTab* (fh: Dos.FileHandlePtr);
BEGIN IF ansi THEN
IO.WriteStr (fh, "\x0B")
END
END VerticalTab;
(* Clear the console's window *)
PROCEDURE FormFeed* (fh: Dos.FileHandlePtr);
BEGIN IF ansi THEN
IO.WriteStr (fh, "\x0C")
END
END FormFeed;
(* Move to first column *)
PROCEDURE CarriageReturn* (fh: Dos.FileHandlePtr);
BEGIN IF ansi THEN
IO.WriteStr (fh, "\x0D")
END
END CarriageReturn;
(*
PROCEDURE (fh: Dos.FileHandlePtr);
BEGIN IO.WriteStr (fh, "\x9B" "")
END ;
PROCEDURE (fh: Dos.FileHandlePtr);
BEGIN IO.WriteStr (fh, "\x9B" "")
END ;
PROCEDURE (fh: Dos.FileHandlePtr);
BEGIN IO.WriteStr (fh, "\x9B" "")
END ;
PROCEDURE (fh: Dos.FileHandlePtr);
BEGIN IO.WriteStr (fh, "\x9B" "")
END ;
*)
PROCEDURE PlainText* (fh: Dos.FileHandlePtr);
BEGIN IF ansi THEN IO.WriteStr (fh, "\x9B" "0m") END
END PlainText;
PROCEDURE BoldfaceText* (fh: Dos.FileHandlePtr; faint, on: BOOLEAN);
BEGIN IF ansi THEN
IF on THEN
IO.WriteStr (fh, "\x9B" "1m")
ELSE
IO.WriteStr (fh, "\x9B" "22m")
END;
IF faint THEN
IO.WriteStr (fh, "\x9B" "2m")
END
END
END BoldfaceText;
PROCEDURE ItalicText* (fh: Dos.FileHandlePtr; on: BOOLEAN);
BEGIN IF ansi THEN
IF on THEN
IO.WriteStr (fh, "\x9B" "3m")
ELSE
IO.WriteStr (fh, "\x9B" "23m")
END
END
END ItalicText;
PROCEDURE UnderscoreText* (fh: Dos.FileHandlePtr; on: BOOLEAN);
BEGIN IF ansi THEN
IF on THEN
IO.WriteStr (fh, "\x9B" "4m")
ELSE
IO.WriteStr (fh, "\x9B" "24m")
END
END
END UnderscoreText;
PROCEDURE ReversedText* (fh: Dos.FileHandlePtr; on: BOOLEAN);
BEGIN IF ansi THEN
IF on THEN
IO.WriteStr (fh, "\x9B" "7m")
ELSE
IO.WriteStr (fh, "\x9B" "27m")
END
END
END ReversedText;
PROCEDURE ConcealedText* (fh: Dos.FileHandlePtr; on: BOOLEAN);
BEGIN IF ansi THEN
IF on THEN
IO.WriteStr (fh, "\x9B" "8m")
ELSE
IO.WriteStr (fh, "\x9B" "28m")
END
END
END ConcealedText;
PROCEDURE CharacterColour* (fh: Dos.FileHandlePtr; colour: LONGINT);
BEGIN IF ansi & (0 <= colour) & (colour <= 7) THEN
IO.WriteF1 (fh, "\x9B" "3%ldm", colour)
END
END CharacterColour;
PROCEDURE CharacterCellColour* (fh: Dos.FileHandlePtr; colour: LONGINT);
BEGIN IF ansi & (0 <= colour) & (colour <= 7) THEN
IO.WriteF1 (fh, "\x9B" "4%ldm", colour)
END
END CharacterCellColour;
PROCEDURE BackgroundColour* (fh: Dos.FileHandlePtr; colour: LONGINT);
BEGIN IF ansi & (0 <= colour) & (colour <= 7) THEN
IO.WriteF1 (fh, "\x9B" ">%ldm", colour)
END
END BackgroundColour;
BEGIN ansi := TRUE
END ANSI.